<script>
    $(function() {
        combo("<?php echo base_url("intranet/administrador/combo/tipoEmpleado") ?>", "tipoPersonal");
    });
</script>
<div class="page-content">
    <div class="page-header position-relative">
        <h1>Personal<small><i class="icon-double-angle-right"></i> Mantenimiento</small></h1>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-header"><h4>Formulario Personal</h4>
                    <span class="widget-toolbar">
                        <a data-action="collapse" href="#">
                            <i class="icon-chevron-up"></i>
                        </a>
                    </span>
                </div>
                <?php
                if (empty($registros)) {
                    $id_pers = "";
                    $nom_per = "";
                    $ape_per = "";
                    $dir_per = "";
                    $dni_per = "";
                    $tel_per = "";
                    $usuario = "";
                } else {
                    $id_pers = $registros[0]->id_pers;
                    $nom_per = $registros[0]->nom_per;
                    $ape_per = $registros[0]->ape_per;
                    $dir_per = $registros[0]->dir_per;
                    $dni_per = $registros[0]->dni_per;
                    $tel_per = $registros[0]->tel_per;
                    $usuario = $registros[0]->usuario;
                }
                ?>
                <div class="widget-body">
                    <div class="widget-body-inner">
                        <div class="widget-main">
                            <form action="<?php echo base_url("intranet/administrador/registrarModificarPersonal"); ?>" class="form-horizontal" method='post'>

                                <div class="row-fluid">
                                    <div class="span5">
                                        <div class="control-group">
                                            <label class="control-label" for="nom">Nombre</label>
                                            <div class="controls">
                                                <input type='hidden' id='cod' name='cod' value="<?php echo $id_pers; ?>" required='required'>
                                                <input type='text' id='nom' name='nom' value="<?php echo $nom_per; ?>" required='required'>
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="ape">Apellido</label>
                                            <div class="controls">
                                                <input type='text' id='ape' name='ape' value="<?php echo $ape_per; ?>" required='required'>
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="dir">Dirección</label>
                                            <div class="controls">
                                                <input type='text' id='dir' name='dir' value="<?php echo $dir_per; ?>" class="span12" required='required'>
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="dni">DNI</label>
                                            <div class="controls">
                                                <input type='text' id='dni' name='dni' value="<?php echo $dni_per; ?>" maxlength='8' class="span4" required='required'>
                                            </div>                                            
                                        </div>
                                    </div>
                                    <div class="span5">
                                        <div class="control-group">
                                            <label class="control-label" for="tel">Teléfono</label>
                                            <div class="controls">
                                                <input type='text' id='tel' name='tel' value="<?php echo $tel_per; ?>" class="span5">
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="usu">Usuario</label>
                                            <div class="controls">
                                                <input type='text' id='usu' name='usu' value="<?php echo $usuario; ?>">
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="tipoPersonal">Tipo</label>
                                            <div class="controls">
                                                <select id='tipoPersonal' name='tipoPersonal'></select>
                                            </div>                                            
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button type='submit' class='btn btn-primary'><i class="icon-save"></i> Guardar</button>                    
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>